# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# CPAN Name  : Switch
# Contributor: AUR Perl <aurperl@juster.info>
# Generator  : CPANPLUS::Dist::Arch 1.12

pkgname='perl-switch'
pkgver=2.17
pkgrel=8
pkgdesc="A switch statement for Perl"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl')
makedepends=()
url='https://search.cpan.org/dist/Switch'
source=(https://search.cpan.org/CPAN/authors/id/C/CH/CHORNY/Switch-$pkgver.tar.gz)
md5sums=('34e2b6dac0a43384505b4e036633cff0')

build() {
  export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
    PERL_AUTOINSTALL=--skipdeps                            \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='"$pkgdir"'"     \
    PERL_MB_OPT="--installdirs vendor --destdir '"$pkgdir"'" \
    MODULEBUILDRC=/dev/null

  cd "$srcdir"/Switch-$pkgver
  perl Makefile.PL
  make
}

check() {
  cd "$srcdir"/Switch-$pkgver
  export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
  make test
}

package() {
  cd "$srcdir"/Switch-$pkgver
  make install
  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}
